import formJs from "./regexDetail.js"; //新增弹框配置项
import publicForm from "@/components/public/el-form.vue"; //弹框form
import TableData from "@/components/stationProductionPage/waterManage/public/el-tables"; //主页面列表


import {
    getWaterInfoByFid, //详情
    getStationmachineByfMachineid, //骨料


    getStationWarnByCompanyId, // 审核流程
    addClosedForm,
    getWaterClosedFormByParentId, //主页面列表详情接口闭合

} from "@/api/request.js";

export default {
    props: [
        "dialogVisible",
        "dialogTitle",
        "statusNum",
        "currentRow",
        "fCompanyid",
        "fCompanyname",
        "modelType",
        "isclose"
    ],
    data() {
        return {
            visible: "",
            formObj: formJs.formObj, //基础信息
            level: [],
            earlyWarning: [], //预警标准
            title: null,
            material_config: formJs.material_config, //材料配置项
            materialData: [], //材料用量列表
            dialogHeight: null,
            formData: {},
            btnShow: true,
            currentDetail: null,
            fCompanynames: null,
            fCompanyids: null,


            formObjInfo: formJs.formObjInfo, //基础信息
            handleObj: formJs.handleObj, //闭合申请单
            processObj:formJs.processObj,//一级审核
            examineObj:formJs.examineObj,//二级审核
            levelThree:formJs.levelThree,//三级审核
            levelFourth:formJs.levelFourth,//四级审核



            handNum: false, //闭合申请单
            firstNum: false, //一级审核
            secondNum: false, //二级审核
            threeLevel: false, //三级审核显示
            fourLevel: false, //四级审核显示
            handleData: {
                fCompanyid: "", // 施工标段id
                fId: "", // 申请单fid //为空判断为新增
                fParentid: "", // 对应的超标记录fid
                fWarningcontent: "", // 预警内容
                fReason: "", // 问题原因
                fHandleway: "", // 处理方式
                fHandleresult: "", // 处理结果
                fHandledate: "",
                fHandledates: this.common.day(0), // 处理日期
                fHandleusername: "", // 处理人名称
                fHandlefile: "", // 处理附件id
                fFirstcheckresult: "", // 一级审核处理结果
                fFirstcheckopinion: "", // 一级审核处理意见
                fFirstcheckusername: "", // 一级审核处理人name
                fFirstcheckdates: this.common.day(0), // 一级审核处理日期
                fSecondcheckresult: "", // 二级审核处理结果
                fSecondcheckopinion: "", // 二级审核处理意见
                fSecondcheckusername: "", // 二级审核处理人name
                fSecondcheckdates: this.common.day(0), // 二级审核处理日期
                fThirdcheckresult: "", // 三级审核处理结果
                fThirdcheckopinion: "", // 三级审核处理意见
                fThirdcheckusername: "", // 三级审核处理人name
                fThirdcheckdates: this.common.day(0), // 三级审核处理日期
                fFourthcheckresult: "", // 四级审核处理结果
                fFourthcheckopinion: "", // 四级审核处理意见
                fFourthcheckusername: "", // 四级审核处理人name
                fFourthcheckdates: this.common.day(0), // 四级审核处理日期

                aduitStatus: null, //保存状态
                userId: "", // 当前登录人id
                userName: "", // 当前登录人姓名
                recordfiles: [], // 删除文件id集合
            },
            status: null,
            checkStatus: null,
            



            activeNames: ["0", "1"],
            fileList: [],
            disabled: false, //表格中间是否禁用
            isEdit: false,

            isLock: false,
            btnStatus: [],
            positionObj: [],

            activeIndex: "1",

            formObjText: formJs.formObjText,
            fSourcefileList: [],

            tableData: [],
            tableObj: [],
            materialObj: [], //材料集合
            specificationObj: [], //规格型号
            suppliernameObj: [], //生产厂商

            baseFormData: {},

            FauditFileurllist: [], //附件

            modelTypes: null,
            engineeringLocationRow: {},
            engineeringLocationShow: false,

            personShow: false,
            selectArr: []


        };
    },
    components: {
        publicForm,
        TableData

    },
    watch: {
        dialogVisible: {
            handler(newVal) {
                if (newVal) {
                    this.visible = newVal;
                }
            },
            immediate: true,
        },
        dialogTitle: {
            handler(newVal) {
                if (newVal) {
                    this.title = newVal;
                }
            },
            immediate: true,
        },
        modelType: {
            handler(newVal) {
                if (newVal) {
                    this.modelTypes = newVal;
                }
            },
            immediate: true,
        },
        statusNum: {
            handler(newVal) {
                if (newVal) {


                    this.edit(newVal);
                }

            },
            immediate: true,
        },

        currentRow: {
            handler(newVal) {
                if (newVal) {
                    this.getExamine(newVal)
                    this.checkStatus = newVal.F_CheckStatus; //闭合状态
                    this.currentDetail = newVal;


                    this.getDetail( this.currentDetail.fId) // currentRow

                }
            },

            immediate: true,
        },

    
        fCompanyid: {
            handler(newVal) {
                if (newVal) {

                    this.fCompanyids = newVal

                }
            },
            immediate: true,
        },
        fCompanyname: {
            handler(newVal) {
                if (newVal) {
                    this.fCompanynames = newVal

                }
            },
            immediate: true,
        },

    },
    created() {
        window.addEventListener("resize", this.getHeight);
        this.getHeight();
    }, //获取页面高度自适应：

    destroyed() {
        window.removeEventListener("resize", this.getHeight);
        this.getHeight();
    },

    mounted() {
        this.userInfo = JSON.parse(sessionStorage.getItem("yjSmart-userInfo"));

        this.btnShow = true


        if (this.statusNum == 7) { //查看
            this.btnShow = false
            this.disabled = true;
            this.isEdit = true
        }
        this.getHeight();
    },
    methods: {

        
         engineeringLocationDialog() {
             this.engineeringLocationShow = false;
         },
         getEngineeringLocation(data) { //获取材料信息
             this.formData.fEnginerringpart = data.F_TreeName; // 报验工程部位
         },
         // 选择工程部位
         // 选择人
         personDialog() {
             this.personShow = false;
         },
         getperson(data) { //单选
 
             this.selectArr = data;
             this.formData.fAppointstationtesterid = data.fUserid;
             this.formData.fAppointstationtestername = data.fRealname;
         },
         // 选择人
         // 折叠面板
         changeCollapse(e) {
             console.log(this.activeNames, e);
         },



         // 刪除文件
         delteFile(file) {
             for (let index = 0; index < this.fileList.length; index++) {
                 if (file.uid == this.fileList[index].uid) {
                     if (this.fileList[index].atta == undefined) {
                         this.formData.recordfiles.push({
                             fId: this.fileList[index].fId,
                         });
                     } else {
                         this.formData.recordfiles.push({
                             fId: this.fileList[index].atta.fId,
                         });
                     }
                     this.fileList.splice(index, 1);
                 }
             }
         },
 
         getExamine(data) {
             var status = data.F_CheckStatus;
             this.status = data.F_CheckStatus;
             this.handleData.aduitStatus = data.F_CheckStatus; //闭合状态
             this.handleData.fParentid = data.F_Id; //对应的超标记录fid
             getStationWarnByCompanyId({
                     companyId: data.F_CompanyId
                 })
                 .then((res) => {
                     if (res.errcode == 0) {
                         var row = res.data.yjQmpMsStationwarn;
 
                         let AduitUserArr = [];
                         let AduitUserData = "";
                         if (data.F_WarningLevel == "1") {
                             AduitUserArr = row.fAduitUser1.split("-");
                         } else if (data.F_WarningLevel == "2") {
                             AduitUserArr = row.fAduitUser2.split("-");
                         } else if (data.F_WarningLevel == "3") {
                             AduitUserArr = row.fAduitUser3.split("-");
                         } else if (data.F_WarningLevel == "4") {
                             AduitUserArr = row.fAduitUser4.split("-");
                         } else if (data.F_WarningLevel == "5") {
                             AduitUserArr = row.fAduitUser5.split("-");
                         }
                         AduitUserData = AduitUserArr[status];
                         console.log(this.userInfo.companyNature, AduitUserData, status, data.F_CloseOperation);
                         this.userInfo = JSON.parse(sessionStorage.getItem("yjSmart-userInfo"));
                         this.btnShow = true;
                         if ((this.userInfo.companyNature == AduitUserData) && data.F_CloseOperation == "未闭合") {
                             if (status == 0) {
                                 // 闭合申请单 可编辑
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = false; //一级审核
                                 this.secondNum = false; //二级审核
                                 this.threeLevel = false; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 this.activeNames = ["0"];
                                 if (this.handleObj.fHandledates == null || this.handleObj.fHandledates == "") {
                                     this.handleObj.fHandledates = this.common.day(0);
                                     this.handleObj.fHandleusername = this.userInfo.realName; //处理人
                                 }
                                 // 闭合申请单
                                 this.handleObj.map((item) => {
                                     item.disabled = false;
                                 });
                                 this.handleObj[0].disabled = true;
                                 this.handleObj[6].uploadSelect = true
 
                                 // 闭合申请单
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 //  二级闭合
 
                                 this.processObj[4].uploadSelect = false
                                 this.examineObj[4].uploadSelect = false
                             } else if (status == 1) {
                                 // 一级审核
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = false; //二级审核
                                 this.threeLevel = false; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 this.activeNames = ["0", "1"];
 
                                 // 闭合申请单
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 闭合申请单
 
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = false;
                                 });
                          
                                 if (this.closeFormData.fFirstcheckdates == null || this.closeFormData.fFirstcheckdates == "") {
                                     this.closeFormData.fFirstcheckdates = this.common.day(0)
                                     this.closeFormData.fFirstcheckusername = this.userInfo.realName; //一级审核人姓名
                                 }
                                 // 一级审核
 
 
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 //  二级闭合
                                 this.handleObj[6].uploadSelect = false
                                 // this.processObj[4].uploadSelect = true
                                 // this.examineObj[4].uploadSelect = false
 
                             } else if (status == 2) {
                                 //    二级审核
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = true; //二级审核
                                 this.activeNames = ["0", "1", "2"];
 
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
 
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = false;
                                 });
                                 // this.examineObj[2].disabled = true;
                                 // this.examineObj[3].disabled = true;
                                 if (this.closeFormData.fSecondcheckdates == null || this.closeFormData.fSecondcheckdates == "") {
                                     this.closeFormData.fSecondcheckdates = this.common.day(0)
                                     this.closeFormData.fSecondcheckusername = this.userInfo.realName; //一级审核人姓名
                                 }
                                 //  二级闭合
                                 this.handleObj[6].uploadSelect = false
                                 // this.processObj[4].uploadSelect = false
                                 // this.examineObj[4].uploadSelect = true
                             } else if (status == 3) {
                              
                                 this.activeNames = ["0", "1", "2","3"];
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = true; //二级审核
                                 this.threeLevel = true; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
 
                                 this.handleObj[6].uploadSelect = false
 
                                  // 三级
                                  this.levelThree.map((item) => {
                                     item.disabled = false;
                                 });
                                 // 三级
                               
                                 //  二级闭合
                             }else if (status == 4) {
                              
                                 this.activeNames = ["0", "1", "2","3","4"];
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = true; //二级审核
                                 this.threeLevel = true; //三级审核显示
                                 this.fourLevel = true; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 //  二级闭合
                                   // 三级
                                   this.levelThree.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 三级
                                 // 四级
                                 this.levelFourth.map((item) => {
                                     item.disabled = false;
                                 });
                             }
                         } else {
                             this.btnShow = false
 console.log('status',status);
 
                             if (status == 0) {
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = false; //一级审核
                                 this.secondNum = false; //二级审核
                                 this.threeLevel = false; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 // 闭合
 
 
                             } else if (status == 1) {
                                 this.activeNames = ["0"];
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = false; //一级审核
                                 this.secondNum = false; //二级审核
                                 this.threeLevel = false; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 // 闭合
 
                             } else if (status == 2) {
                                 this.activeNames = ["0", "1"]
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = false; //二级审核
                                 this.threeLevel = false; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
 
                             } else if (status == 3) {
                                 this.activeNames = ["0", "1", "2"]
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = true; //二级审核
                                 this.threeLevel = false; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 //  二级闭合
 
                             } else if (status == 4) {
                                 this.activeNames = ["0", "1", "2", "3"]
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = true; //二级审核
                                 this.threeLevel = true; //三级审核显示
                                 this.fourLevel = false; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
 
                                 //  二级闭合
                                 // 三级
                                 this.levelThree.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 三级
 
 
 
                             } else if (status == 5) {
                                 this.activeNames = ["0", "1", "2", "3", "4"]
                                 this.handNum = true; //闭合申请单
                                 this.firstNum = true; //一级审核
                                 this.secondNum = true; //二级审核
                                 this.threeLevel = true; //三级审核显示
                                 this.fourLevel = true; //四级审核显示
                                 // 闭合
                                 this.handleObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 this.handleObj[6].uploadSelect = false
                                 // 闭合
                                 // 一级审核
                                 this.processObj.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 一级审核
                                 //  二级闭合
                                 this.examineObj.map((item) => {
                                     item.disabled = true;
                                 });
 
                                 //  二级闭合
                                 // 三级
                                 this.levelThree.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 三级
                                 // 四级
                                 this.levelFourth.map((item) => {
                                     item.disabled = true;
                                 });
                                 // 四级
 
                             }
                         }
                     }
                 })
                 .catch((error) => {
                     console.log(error);
                 });
         },
         yj_saveForm() {
            this.handleData.userId = this.userInfo.userId; // //编制人id
            this.handleData.userName = this.userInfo.realName; // //编制人
            var text = 'publicForm' + this.status
            console.log(this.$refs[text], this.handleData);
            if (this.$refs[text].submitForm()) {
                this.saveForm(this.handleData, 0);
            }
            // if (this.status == 0) {
            //     if(this.$refs.publicForm0.submitForm()){
            //         this.saveForm(this.formData, 0);
            //     }

            // } else if (this.status == 1) {
            //     if(this.$refs.publicForm1.submitForm() ){
            //         this.saveForm(this.formData, 1);
            //     }


            // } else if (this.status == 2) {

            //     if(this.$refs.publicForm2.submitForm()  ){
            //         this.saveForm(this.formData, 0);
            //     }
            // }else if (this.status == 3) {

            //     if(this.$refs.publicForm3.submitForm()  ){
            //         this.saveForm(this.formData, 0);
            //     }
            // } else if (this.status == 4) {

            //     if(this.$refs.publicForm4.submitForm()  ){
            //         this.saveForm(this.formData, 0);
            //     }
            // }else {
            //     console.log("error");
            // }

        },
        // 保存
        saveForm(obj) {
            console.log(obj);
            this.isLock = true
            addClosedForm(obj)
                .then((res) => {
                    if (res.errcode == 0) {
                        this.visible = false;
                        this.$emit("refreshList");
                        this.$message.success("新增成功");
                        this.isLock = false
                    } else {
                        this.isLock = false
                        this.$message.error(res.msg);
                        console.log("接口报错");
                    }
                })
                .catch((error) => {
                    console.log("拌合站设置-新增）", error);
                });
        },
        // 选择工程部位
        refreshList() {},

        getHeight() {
            var h = document.documentElement.clientHeight; //获取页面可见高度
            this.dialogHeight = h * 0.76 + "px";
        },
        handleSelect(key) {
            this.activeIndex = key;
        },
        closeDialog() {
            this.$emit("close");
        },


        clickDialog(index, prop) {
            console.log(index, prop);
            if (index == 5 && prop == "fEnginerringpart") {
                this.engineeringLocationShow = true;
            } else if (index == 2 && prop == "fAppointstationtestername") {
                this.personShow = true;
            }
        },
        edit() {
            this.closeFormData = this.$options.data.call(this).closeFormData;
        },
        // 详情
        getDetail(obj) {
            var str;
       
            if (this.isclose) {
                str = getWaterClosedFormByParentId;
              
            } else {
                str = getWaterInfoByFid;
              
            }
           str({
                    fId: obj,
                    companyId: this.fCompanyids,
                })
                .then((res) => {
                    if (res.errcode == 0) {
                        
                       
                        this.getGlName(res.data.fMachineid);
                       
                        var totalData = res.data.closeinfo; //闭合申请单、一级、二级审核
                        if (this.isclose) {
                            this.formData = res.data.dischargeinfo; //基本信息及材料用量
                          
                        } else {
                            this.formData = res.data;
                          
                        }
                        this.handleData.fParentid = obj; //对应的超标记录fid
                        if (this.checkStatus == 0) {
                            this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
                            this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
                            this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
                            this.handleData.fCompanyid = this.formData.fCompanyid; // 施工标段id
                          } else if (this.checkStatus == 1) {
                            this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
                            this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
                            this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
                            this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
              
                            this.handleData.fReason = totalData.fReason; // 问题原因
                            this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                            this.handleData.fHandledates = totalData.fHandledates; //处理日期
                            this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                            this.fSourcefileList = res.data.fSourcefileList; // 附件
                            this.handleData.fHandleway = totalData.fHandleway; // 处理方式
                          } else if (this.checkStatus == 2) {
                            this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
                            this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
                            this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
                            this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
              
                            this.handleData.fReason = totalData.fReason; // 问题原因
                            this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                            this.handleData.fHandledates = totalData.fHandledates; //处理日期
                            this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                            this.fSourcefileList = res.data.fSourcefileList; // 附件
                            this.handleData.fHandleway = totalData.fHandleway; // 处理方式
              
                            this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
                            this.handleData.fFirstcheckopinion = totalData.fFirstcheckopinion; // 一级审核处理意见
                            this.handleData.fFirstcheckusername =
                              totalData.fFirstcheckusername; //一级审核处理人name
                            this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期
                          } else if (this.checkStatus == 3) {
                            this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
                            this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
                            this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
                            this.handleData.fReason = totalData.fReason; // 问题原因
              
                            this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                            this.handleData.fHandledates = totalData.fHandledates; //处理日期
                            this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                            this.fSourcefileList = res.data.fSourcefileList; // 附件
                            this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
                            this.handleData.fHandleway = totalData.fHandleway; // 处理方式
              
                            this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
                            this.handleData.fFirstcheckopinion = totalData.fFirstcheckopinion; // 一级审核处理意见
                            this.handleData.fFirstcheckusername =
                              totalData.fFirstcheckusername; //一级审核处理人name
                            this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期
              
                            this.handleData.fSecondcheckresult = totalData.fSecondcheckresult; // 二级审核处理结果
                            this.handleData.fSecondcheckopinion =
                              totalData.fSecondcheckopinion; // 二级审核处理意见
                            this.handleData.fSecondcheckusername =
                              totalData.fSecondcheckusername; //二级审核处理人name
                            this.handleData.fSecondcheckdates = totalData.fSecondcheckdates; //二级审核处理日期
                          }
                        this.materialData = [{
                                // fCement2deviatevalue
                                name: "实际称量值(t)",
                                cement1: res.data.fCement1actualweighingvalue,
                                cement2: res.data.fCement2actualweighingvalue,
                                aggregate1: res.data.fAggregate1actualweighingvalue,
                                aggregate2: res.data.fAggregate2actualweighingvalue,
                                aggregate3: res.data.fAggregate3actualweighingvalue,
                                aggregate4: res.data.fAggregate4actualweighingvalue,
                                aggregate5: res.data.fAggregate5actualweighingvalue,
                                aggregate6: res.data.fAggregate6actualweighingvalue,
                                water: res.data.fWateractualweighingvalue,

                                // cement3: "",
                            },
                            {
                                name: "设定比例(%)",
                                cement1: res.data.fCement1designratio,
                                cement2: res.data.fCement2designratio,
                                aggregate1: res.data.fAggregate1designratio,
                                aggregate2: res.data.fAggregate2designratio,
                                aggregate3: res.data.fAggregate3designratio,
                                aggregate4: res.data.fAggregate4designratio,
                                aggregate5: res.data.fAggregate5designratio,
                                aggregate6: res.data.fAggregate6designratio,
                                water: res.data.fWaterdesignratio,
                            },
                            {
                                name: "实际比例(%)",
                                cement1: res.data.fCement1actualratio, //水泥1
                                cement2: res.data.fCement2actualratio, //水泥2
                                aggregate1: res.data.fAggregate1actualratio, //骨料1
                                aggregate2: res.data.fAggregate2actualratio, //骨料2
                                aggregate3: res.data.fAggregate3actualratio, //骨料3
                                aggregate4: res.data.fAggregate4actualratio, //骨料4
                                aggregate5: res.data.fAggregate5actualratio, //骨料5
                                aggregate6: res.data.fAggregate6actualratio, //骨料6
                                water: res.data.fWateractualratio, //水
                            },
                            {
                                name: "偏差(%)",
                                cement1: res.data.fCement1deviatevalue, //水泥1
                                cement2: res.data.fCement2deviatevalue, //水泥2
                                aggregate1: res.data.fAggregate1deviatevalue, //骨料1
                                aggregate2: res.data.fAggregate2deviatevalue, //骨料2
                                aggregate3: res.data.fAggregate3deviatevalue, //骨料3
                                aggregate4: res.data.fAggregate4deviatevalue, //骨料4
                                aggregate5: res.data.fAggregate5deviatevalue, //骨料5
                                aggregate6: res.data.fAggregate6deviatevalue, //骨料6
                                water: res.data.fWaterdeviatevalue, //水
                            },
                            {
                                name: "预警范围值",
                                show: true,
                                cement1: res.data.fCement1warninginfo, //水泥1
                                cement2: res.data.fCement2warninginfo, //水泥2
                                aggregate1: res.data.fAggregate1warninginfo, //骨料1
                                aggregate2: res.data.fAggregate2warninginfo, //骨料2
                                aggregate3: res.data.fAggregate3warninginfo, //骨料3
                                aggregate4: res.data.fAggregate4warninginfo, //骨料4
                                aggregate5: res.data.fAggregate5warninginfo, //骨料5
                                aggregate6: res.data.fAggregate6warninginfo, //骨料5
                                water: res.data.fWaterwarninginfo, //水
                            },
                        ];
                        this.level = [
                            "",
                            res.data.fCement1warninglevel,
                            res.data.fCement2warninglevel,
                            res.data.fAggregate1warninglevel,
                            res.data.fAggregate2warninglevel,
                            res.data.fAggregate3warninglevel,
                            res.data.fAggregate4warninglevel,
                            res.data.fAggregate5warninglevel,
                            res.data.fAggregate6warninglevel,
                            res.data.fWaterwarninglevel,
                        ];
                        this.earlyWarning = [
                            "",
                            res.data.fCement1warninginfo,
                            res.data.fCement2warninginfo,
                            res.data.fAggregate1warninginfo,
                            res.data.fAggregate2warninginfo,
                            res.data.fAggregate3warninginfo,
                            res.data.fAggregate4warninginfo,
                            res.data.fAggregate5warninginfo,
                            res.data.fAggregate6warninginfo,
                            res.data.fWaterwarninginfo,
                        ];
                    } else {
                        this.$message.error(res.msg);
                        console.log("接口报错");
                    }
                })
                .catch((error) => {
                    console.log("拌合站设置编辑报错", error);
                });

        },
        // 获取骨料名
        getGlName(data) {
            getStationmachineByfMachineid({
                    machineId: data
                })
                .then((res1) => {
                    if (res1.errcode == 0) {
                        this.material_config.thead[3].label =
                            res1.data.yjQmpMsStationmachine.fParm1;
                        this.material_config.thead[4].label =
                            res1.data.yjQmpMsStationmachine.fParm2;
                        this.material_config.thead[5].label =
                            res1.data.yjQmpMsStationmachine.fParm3;
                        this.material_config.thead[6].label =
                            res1.data.yjQmpMsStationmachine.fParm4;
                        this.material_config.thead[7].label =
                            res1.data.yjQmpMsStationmachine.fParm5;
                        this.material_config.thead[8].label =
                            res1.data.yjQmpMsStationmachine.fParm6;
                    } else {
                        this.$message.error("获取骨料名", res1.msg);
                    }
                })
                .catch((error) => {
                    console.log("获取骨料名接口报错", error.msg);
                });
        },
    },
};